package pro.shuangxi.common.vo;

/**
 * @author ：mengshx
 * @date ：Created in 2021/4/10 16:58
 * @description：响应
 */
public class Result {
    String msg = "";
    Integer code = 0;
    Object data = null;

    public static Result OK(String msg) {
        Result result = new Result();
        result.setCode(200);
        result.setMsg(msg);
        return result;
    }

    public static Result OK(Object data) {
        Result result = new Result();
        result.setCode(200);
        result.setData(data);
        return result;
    }
    public static Result OK(String msg, Object data) {
        Result result = new Result();
        result.setCode(200);
        result.setData(data);
        result.setMsg(msg);
        return result;
    }
    public static Result ERR(String msg) {
        Result result = new Result();
        result.setCode(500);
        result.setMsg(msg);
        return result;
    }
    public static Result error(String msg) {
        Result result = new Result();
        result.setCode(500);
        result.setMsg(msg);
        return result;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
